widget: Simplify snapshot_child
authorTimm Bäder <mail@baedert.org>
Tue, 4 Jul 2017 13:41:27 +0000 (15:41 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:15 +0000 (21:27 -0400)
gtk/gtkwidget.c

index dda485691c07858c9f12165dd7c8098ce8753d7d..4cb273a23b8b5b2bbfac8b5687b1f8005672df04 100644 (file)
@@ -15666,15 +15666,14 @@ gtk_widget_snapshot_child (GtkWidget   *widget,
                            GtkWidget   *child,
                            GtkSnapshot *snapshot)
 {
-  GtkAllocation content_allocation;
+  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (child);
   int x, y;
 
   g_return_if_fail (_gtk_widget_get_parent (child) == widget);
   g_return_if_fail (snapshot != NULL);
 
-  _gtk_widget_get_allocation (child, &content_allocation);
-  x = content_allocation.x;
-  y = content_allocation.y;
+  x = priv->allocation.x;
+  y = priv->allocation.y;
 
   gtk_snapshot_offset (snapshot, x, y);
   gtk_widget_snapshot (child, snapshot);